home *** CD-ROM | disk | FTP | other *** search
-
-
-
- MOUSE Devices MOUSE
-
-
-
- _________________________________________________________________
-
- NNAAMMEE
- mouse - Devices used to read mouse and keyboard events for
- window systems
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ddeevv//mmoouussee..hh>>
-
- _________________________________________________________________
-
-
- DDEESSCCRRIIPPTTIIOONN
- Mouse devices are used by window systems to communicate with
- the raw keyboard and mouse. Each rreeaadd kernel call on a
- mouse device returns one or more structures of the following
- format:
-
- typedef struct {
- int flags;
- int key;
- int deltaX;
- int deltaY;
- unsigned int time;
- } Mouse_Event;
- The buffer specified to a rreeaadd kernel call must be large
- enough to hold at least one MMoouussee__EEvveenntt. The _f_l_a_g_s field is
- an OR-ed combination of the following bit masks:
-
- MMOOUUSSEE__EEVVEENNTT Means that a mouse button was
- pressed or released, or the mouse
- moved.
-
- KKEEYYBBOOAARRDD__EEVVEENNTT Means that a key was pressed or
- released on the keyboard. Only one
- of MMOOUUSSEE__EEVVEENNTT or KKEEYYBBOOAARRDD__EEVVEENNTT
- will be set in any particular
- event.
-
- KKEEYY__UUPP This bit is only relevant for key-
- board events. If set, it implies
- that the key was released; other-
- wise, the key was pressed.
-
- For mouse events, the _k_e_y field contains a bit mask indicat-
- ing which mouse buttons are currently depressed. The _d_e_l_t_a_X
- and _d_e_l_t_a_Y fields indicate how much the mouse has moved (in
- pixels) since the last mouse-related event. The _t_i_m_e field
- gives the value of a free-running millisecond clock at the
- time the event occurred. The _t_i_m_e value has no absolute
- significance, but is useful in comparing times from dif-
- ferent events.
-
- For keyboard events, the _k_e_y field gives the number of a key
-
-
-
- Sprite v.1.0 Printed: June 25, 1989 1
-
-
-
-
-
-
- MOUSE Devices MOUSE
-
-
-
- on the keyboard. The numbers are keyboard-specific, and are
- usually different than the ASCII values represented by the
- keys. The KKEEYY__UUPP mask bit indicates whether the given key
- just went up or down. For ideal keyboards, such as those on
- most Sun workstations, separate up and down events occur for
- each key. For less-than-ideal keyboards, such as DEC's
- LK201, down events occur for all keys, but up events only
- occur for a few keys such as shift. The _d_e_l_t_a_X and _d_e_l_t_a_Y
- fields have no significance for keyboard events, and _t_i_m_e is
- the same as for mouse events.
-
- Writing to a mouse device has machine-specific effects. On
- Suns, characters written to a mouse device are transmitted
- to the keyboard and perform the following special functions,
- depending on the value of the character:
-
- KKBBDD__RREESSEETT ((11)) Reset the keyboard.
-
- KKBBDD__BBEELLLL__OONN ((22)) Turn on the bell. It will stay on
- until the KKBBDD__BBEELLLL__OOFFFF character is
- transmitted.
-
- KKBBDD__BBEELLLL__OOFFFF ((33)) Turn off the bell.
-
- KKBBDD__CCLLIICCKK__OONN ((1100)) Generate a click on each keystroke.
-
- KKBBDD__CCLLIICCKK__OOFFFF ((1111)) Stop clicking on each keystroke.
-
- No device-specific IO-control operations are defined for
- mouse devices.
-
-
- KKEEYYWWOORRDDSS
- event, keyboard, mouse, window system
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sprite v.1.0 Printed: June 25, 1989 2
-
-
-
-